import {action,observable,makeAutoObservable} from "mobx";

interface IUser {
    name : string
    token : string

}
export default class User {
    @observable name : string = ''


    constructor(name: string = '') {
        this.name = name;
        makeAutoObservable(this)
    }

    @action
    public  login =(name: string) =>{
        //支持异步操作
        this.name = name
    }
    @action
    public logout =()=>{
        this.name = "";
    }
}
